# -*- coding:utf-8 -*-

import numpy as np
import matplotlib.pyplot as plt

# from matplotlib.font_manager import FontProperties
#
# # 设置中文字体，fname是我的电脑中的字体的路径
# font = FontProperties(fname='C:/Users/Administrator/AppData/Local/Microsoft/Windows/Fonts/造字工房尚黑细长体.otf',
#                       size=10)

from matplotlib import rcParams

rcParams['font.family'] = 'SimHei'

labels = ['蒙德', '璃月', '稻妻', '须弥', '枫丹', '纳塔', '至冬']
values = np.array([18800, 140000, 13000, 231400, 69000, 108150, 46500])

fig = plt.figure()
sub = fig.add_subplot(111)
sub.pie(values, labels=labels,
        colors=['c', 'gold', 'mediumpurple', 'limegreen', 'aqua', 'crimson', 'beige'],
        explode=[0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05],
        autopct='%.1f%%', textprops=dict(fontsize=12), radius=1.0,
        shadow=True,
        wedgeprops=dict(
            edgecolor='w', width=0.24
        ))

fig.tight_layout()
plt.show()
